What is the `Array.prototype.map` method in JavaScript?
Description : `map` creates a new array with the results of calling a provided function on every element in the calling array.
Answer :
`Array.prototype.map` creates a newarraywith the results of calling a provided function on every element in the calling array. It does not modify the original array.const arr =[1,2,3];const doubled = arr.map(num=> num *2);
console.log(doubled);// [2, 4, 6]
`String.prototype.anchor` creates an HTML`<a>` element wrapping the string with a specified name attribute. This method is deprecated and should not be used in modern applications.const str ='Click here';const anchoredStr = str.anchor('top');
console.log(anchoredStr);// '<a name="top">Click here</a>'
`String.prototype.anchor` creates an HTML`<a>` element wrapping the string with a specified name attribute. This method is deprecated and should not be used in modern applications.const str ='Click here';const anchoredStr = str.anchor('top');
console.log(anchoredStr);// '<a name="top">Click here</a>'
What is the `String.prototype.small` method in JavaScript?
`String.prototype.small` returns a string wrapped inHTML`<small>` tags. This method is deprecated and should not be used in modern applications.const str ='hello';const smallStr = str.small();
console.log(smallStr);// '<small>hello</small>'
`String.prototype.small` returns a string wrapped inHTML`<small>` tags. This method is deprecated and should not be used in modern applications.const str ='hello';const smallStr = str.small();
console.log(smallStr);// '<small>hello</small>'